home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / Tools Plus 2.5 / Tools Plus 2.5 (C⁄C++ & Pascal) / User Manual / 05-Windows (2 of 2) < prev    next >
Encoding:
Text File  |  1994-05-24  |  30.6 KB  |  514 lines  |  [TEXT/ttxt]

  1.  
  2. WindowClose
  3. ```````````
  4. Close an open window, tool bar or floating palette.
  5.  
  6.    pascal void WindowClose (short Window);
  7.  
  8.    procedure WindowClose(Window: INTEGER);
  9.  
  10.   The WindowClose procedure closes a window that was opened by WindowOpen, or a tool bar that was opened with ToolBarOpen.  If a standard window is being closed, the window immediately behind the newly closed window (if one exists) becomes active and current.
  11.  
  12.   Window specifies the window number that is closed.  If the specified window is not open, WindowClose does nothing.
  13.  
  14.   When a window is closed, it automatically releases the memory that was consumed by its associated buttons (including radio buttons and check boxes), picture buttons, pop-up menus, scroll bars, editing fields, list boxes, and custom controls.
  15.  
  16.   When working with windows that are opened and closed frequently, you can take advantage of the WindowDisplay routine which hides and displays a window.  This is particularly useful when used on a tool bar or a floating palette because a hidden window remembers the settings of all the objects on the window (picture buttons, check boxes and radio buttons, editing fields, etc.) as well as the window’s location.  When the window is displayed again, it is identical in position and appearance as when it was hidden.
  17.  
  18. ------------------------------------------------------------------------
  19.  
  20. WindowSize
  21. ``````````
  22. Change a window’s size or a tool bar’s height.
  23.  
  24.    pascal void WindowSize (short Window, short Width, short Height,
  25.                  Boolean Update);
  26.  
  27.    procedure WindowSize (Window, Width, Height: INTEGER;
  28.                  Update: BOOLEAN);
  29.  
  30.   The WindowSize routine is used to change a window’s width and/or height without changing its position on the screen.  In most situations, windows that need resizing are best accommodated by the documentProc procID which provides a grow box in the bottom right corner of the window, and optionally a zoom box in the title bar.  Some applications, however, need a window that presents an “expanded” view.  An example of this the Macintosh’s Alarm Clock desk accessory which expands to let the user change the time, calendar and alarm timer.  Your application should change a window’s size only in response to some action taken by the user.
  31.  
  32.   Window specifies the window number that is resized.  If the specified window is not open, WindowSize does nothing.
  33.  
  34.   Width and Height specify the window’s new dimensions in pixels.  These dimensions relate to those specified by the WindowOpen routine, that is, they represent the content region or usable area of the window (the window’s frame, shadow, and title bar are all created outside of these co-ordinates).  The tool bar’s width cannot be changed, and its height cannot exceed 70 pixels.  All other windows’ new dimensions are automatically adjusted to keep them within the window’s size limits which are set with SetWindowSizeLimits.  If you specify zero (0) for either of these dimensions, it specifies that dimensions (height or width) should not be changed (i.e., WindowSize(1, 80, 0, true) changes window 1’s width to 80 pixels and leaves the height unchanged.
  35.  
  36.   Update specifies if the newly exposed area is added to the window’s update region (thereby producing a doRefresh event).  If you specify true, the newly exposed area is added to the window’s update region.  If you specify false, your application will handle the newly exposed area.
  37.  
  38. ------------------------------------------------------------------------
  39.  
  40. WindowMove
  41. ``````````
  42. Move a window to another location on the screen.
  43.  
  44.    pascal void WindowMove (short Window, short hGlobal, short vGlobal,
  45.                  short procID);
  46.  
  47.    procedure WindowMove (Window, hGlobal, vGlobal, procID: INTEGER);
  48.  
  49.   WindowMove repositions a window on the screen without changing its size.  Do not use WindowMove in place of having the user move a window to a new location by dragging the title bar.  Windows should only be moved in response to a user’s action, such as selecting an “Arrange Windows” menu item that arranges all open windows in a specified manner (grid or tile, for example).
  50.  
  51.   Window specifies the window number that is moved.  If the specified window is not open, WindowMove does nothing.
  52.  
  53.   HGlobal and vGlobal specify the window’s new location in global co-ordinates.  These dimensions relate to the top left corner specified by the WindowOpen routine, that is, they represent the top left corner of the content region or usable area of the window (the window’s frame, shadow, and title bar are all created outside of these co-ordinates).  The tool bar cannot be moved.
  54.  
  55.   ProcID specifies optional behavior that can take place while moving the window.  The value for this 2-byte integer can be specified by adding a set of constants to obtain the desired result.  The options are:
  56.  
  57.    wAnimateMove        Show “zoom lines” that move from the window’s
  58.                        original position to the window’s new position
  59.                        (see the ZoomLines routine for details).
  60.  
  61.    wOffsetForToolBar   Offset the specified vertical co-ordinate
  62.                        downward by the tool bar’s height (if a tool bar
  63.                        is open).
  64.  
  65.   CONST                       {Window moving options:              }
  66.     wAnimateMove      = $01;  {Animate with Zoom Lines             }
  67.     wOffsetForToolBar = $02;  {Offset co-ords by tool bar’s height }
  68.  
  69. ------------------------------------------------------------------------
  70.  
  71. WindowDisplay
  72. `````````````
  73. Hide or show a window, floating palette, or tool bar.
  74.  
  75.    pascal void WindowDisplay (short Window, Boolean Show);
  76.  
  77.    procedure WindowDisplay (Window: INTEGER; Show: BOOLEAN);
  78.  
  79.    From a user’s perspective, a window that is “hidden” by your application is actually being closed.  If a standard window is hidden, the standard window behind it is activated.  When a window is displayed (unhidden), it appears as though the window was opened, in that it appears at the front of its layer and becomes “active” and “current.”  Your application should hide and show windows in response to a user’s action, such as selecting a “Hide Tool Bar” menu item.  Tools Plus automatically hides the tool bar and all floating palettes when your application is suspended under MultiFinder or System 7, and displays them when your application is activated.
  80.  
  81.   Window specifies the window number that is hidden or shown.  You cannot hide a modal window.
  82.  
  83.   Show indicates if the window is being hidden or displayed.  The two constants that can be used for this flag are wShow and wHide.
  84.  
  85.   When working with windows that are opened and closed frequently, you can take advantage of WindowDisplay instead of closing the window and opening it and having to recreate its contents.  This is particularly useful when used on a tool bar or a floating palette because a hidden window remembers the settings of all the objects on the window (picture buttons, check boxes and radio buttons, editing fields, etc.) as well as the window’s location.  When the window is displayed again, it is identical in position and appearance as when it was hidden.
  86.  
  87.   Before you hide a window, realize that the user thinks the window is being closed (even though it may only be temporary).  Don’t leave the window in an “unsettled” state when your are hiding it.  Make sure that all editing fields are validated and processed.
  88.  
  89.   When a window is hidden, it does not release any memory consumed by its associated user interface elements such as buttons (including radio buttons and check boxes), picture buttons, pop-up menus, scroll bars, editing fields, list boxes, and custom controls.
  90.  
  91.   CONST                   {Window displaying options:  }
  92.     wShow = true;         {Display (unhide)            }
  93.     wHide = false;        {Hide window                 }
  94.  
  95. ------------------------------------------------------------------------
  96.  
  97. ActivateWindow
  98. ``````````````
  99. Activate a window.
  100.  
  101.    pascal void ActivateWindow (short Window);
  102.  
  103.    procedure ActivateWindow(Window: INTEGER);
  104.  
  105.   Window specifies the window number that is activated.  The specified window is brought forward and becomes “active” and “current.”  This window is also considered to be the “work” window.  If the window is hidden or not open, ActivateWindow does nothing.
  106.  
  107.   If the tool bar is activated, it simply becomes the current window (because the tool bar is always active).  If a floating palette is activated, it is brought to the front of the floating palette layer without deactivating any windows.  When a standard window is activated, it is brought to the front of the standard window layer, and the previously active standard window is deactivated
  108.  
  109.   A window will normally be activated only in response to a doChgWindow event that is reported during polling.  Another possible use of ActivateWindow is if your application has a “Window” menu that lets the user activate a window from a menu.  Don’t mysteriously activate an inactive window.
  110.  
  111. ------------------------------------------------------------------------
  112.  
  113. CurrentWindow
  114. `````````````
  115. Make a window the current window without activating it.
  116.  
  117.    pascal void CurrentWindow (short Window);
  118.  
  119.    procedure CurrentWindow(Window: INTEGER);
  120.  
  121.   Subsequent window related operations such as drawing, and creating fields, buttons, scroll bars, etc., will occur in the specified window without making it the “active” window.  This routine is used to redirect your application’s actions to a window other than the active one.
  122.  
  123.   Window specifies the window number in which subsequent window related operations will occur.  If the specified window is not open, CurrentWindow does nothing.
  124.  
  125.   The CurrentWindowReset procedure resets window operations back to the “active” window making the active window current too.  You should get into the habit of leaving the active window current.  It makes debugging much simpler.
  126.  
  127. ------------------------------------------------------------------------
  128.  
  129. CurrentWindowReset
  130. ``````````````````
  131. Reset the “current” window to be the same as the “active” window.
  132.  
  133.    pascal void CurrentWindowReset(void);
  134.  
  135.    procedure CurrentWindowReset;
  136.  
  137.   Subsequent window related operations such as drawing, and creating fields, buttons, scroll bars, etc., will occur in the “active” window.  This procedure nullifies the effect of the CurrentWindow procedure making the “active” window current also.  If your application uses a tool bar and/or floating palettes, then the work window will become current.
  138.  
  139. ------------------------------------------------------------------------
  140.  
  141. WindowTitle
  142. ```````````
  143. Change a window’s title.
  144.  
  145.    pascal void WindowTitle (short Window, Str255 Title);
  146.  
  147.    procedure WindowTitle(Window: INTEGER; Title: STRING);
  148.  
  149.   The WindowTitle procedure changes the title for an open window, regardless if it is active or not.  You can only see the change on windows that have a title bar (documentProc, noGrowDocProc, rDocProc, paletteProc and ordPaletteProc).  You won’t see any change on windows that do not display titles (dBoxProc, plainDBox, altDBoxProc, altPaletteProc, and the tool bar).
  150.  
  151.   Window specifies the window number in which the title is to be changed.  The specified window does not have to be the “active” window, however, the window must be opened to display the title.  Hidden windows will display the new title once they become visible.  If the window is not open, WindowTitle does nothing.
  152.  
  153. Title contains the window’s new title.
  154.  
  155. ------------------------------------------------------------------------
  156.  
  157. SetWindowSizeLimits
  158. ```````````````````
  159.   Set a window’s size limits that will determine the minimum and maximum size allowable when using the “size box” or “zoom box.”
  160.  
  161.    pascal void SetWindowSizeLimits (short minHoriz, short minVert,
  162.                  short maxHoriz, short MaxVert);
  163.  
  164.    procedure SetWindowSizeLimits(minHoriz, minVert, maxHoriz,
  165.                  maxVert: INTEGER);
  166.  
  167.   MinHoriz specifies the minimum width (in pixels) the window may attain when being sized.
  168.  
  169.   MinVert specifies the minimum height (in pixels) the window may attain when being sized.
  170.  
  171.   MaxHoriz specifies the maximum width (in pixels) the window may attain when being sized.
  172.  
  173.   MaxVert specifies the maximum height (in pixels) the window may attain when being sized.
  174.  
  175.   SetWindowSizeLimits affects only the current window.  If the current window is not a Tools Plus window, SetWindowSizeLimits does nothing.  The minimum and maximum limits imposed on a window are automatically adjusted (if necessary) to ensure that the window’s current size does not exceed the adjusted limits.  For example, if the minHoriz limit is set to 100 pixels and the window is currently 90 pixels wide (10 pixels smaller than the specified minimum width), minHoriz is adjusted to 90 pixels.  The same applies if the maximum limit is exceeded by the window’s current dimensions.
  176.  
  177.   By setting these limits, it is possible to allow a window to be sized horizontally or vertically only.
  178.  
  179. ------------------------------------------------------------------------
  180.  
  181. SetWindowZoom
  182. `````````````
  183.   Set a window’s standard co-ordinates and user co-ordinates that are in effect when the window’s “zoom box” is clicked.
  184.  
  185.    pascal void SetWindowZoom (Rect *userRect, Rect *stdRect);
  186.  
  187.    procedure SetWindowZoom(userRect, stdRect: RECT);
  188.  
  189.   A window containing a zoom box has two different states: [1] the standard state, and [2] the user state.  The user can change the window’s size and/or location, thereby defining the user state.  When the zoom box is clicked, the window “zooms” back to the standard state (which, by default, is the window’s co-ordinates when it was first opened).  Clicking the zoom box again reverts to the user state.
  190.  
  191.   Sometimes it is desirable to have the standard state and/or user state something other than the window’s initial co-ordinates.  SetWindowZoom sets either or both of these.  The window’s current co-ordinates become the user state.  It is good form to call SetWindowZoom immediately after opening a window.
  192.  
  193.   UserRect defines a rectangle in global co-ordinates that determines the window’s user co-ordinates.  If the current window is not a Tools Plus window, if the current window has no zoom box, or if an empty rectangle is specified, the user co-ordinates are not set.
  194.  
  195.   StdRect defines a rectangle in global co-ordinates that determines the window’s standard co-ordinates.  If the current window is not a Tools Plus window, if the current window has no zoom box, or if an empty rectangle is specified, the standard co-ordinates are not set.
  196.  
  197.   If the tool bar is open and it was created with the tbOffsetNewWindows option, this window’s co-ordinates for userRect and stdRect are shifted downwards by an amount that is equal to the tool bar’s height.
  198.  
  199. Warning: When you set the user and standard co-ordinates, make sure that
  200.          they are such that at least part of the window’s title bar is
  201.          visible to allow the window to be dragging back into view
  202.          (don’t zoom to an “off-screen” window).  Ideally, the zoom box
  203.          should always be visible.
  204.  
  205. ------------------------------------------------------------------------
  206.  
  207. GetWindowZoom
  208. `````````````
  209. Get a window’s standard state and user state for zooming.
  210.  
  211.    pascal void GetWindowZoom (Rect *userRect, Rect *stdRect);
  212.  
  213.    procedure GetWindowZoom(var userRect, stdRect: RECT);
  214.  
  215.   A window containing a zoom box has two different states: [1] the standard state, and [2] the user state.  The user can change the window’s size and/or location, thereby defining the user state.  When the zoom box is clicked, the window “zooms” back to the standard state (which, by default, is the window’s co-ordinates when it was first opened).  Clicking the zoom box again reverts to the user state.
  216.  
  217.   UserRect defines the window’s user state in the screen’s global co-ordinates.
  218.  
  219.   StdRect defines the window’s standard state in the screen’s global co-ordinates.
  220.  
  221.   If the tool bar is open and it was created with the tbOffsetNewWindows option, this window’s userRect and stdRect are shifted upwards by an amount that is equal to the tool bar’s height (i.e., they are shifted up as though there was no tool bar)..
  222.  
  223.   GetWindowZoom gets the values for the current window.  If the current window is not a Tools Plus window, or if the current window has no zoom box, the userRect and stdRect rectangles are undefined.  This procedure is useful if you want to save both states as part of the document.  When the document is opened, a window could be created using the userRect co-ordinates, and the user and standard state can be set by using the SetWindowZoom procedure.
  224.  
  225. ------------------------------------------------------------------------
  226.  
  227. WindowStatus
  228. ````````````
  229. Get a window’s status information.
  230.  
  231.    pascal void WindowStatus (short Window, TPWindowStatus *Status);
  232.  
  233.    procedure WindowStatus(Window: INTEGER; var Status: TPWindowStatus);
  234.  
  235.   The WindowStatus procedure returns the status of any Tools Plus window, whether it is open or closed, displayed or hidden.
  236.  
  237.   Window is the window number of a Tools Plus window.  Window must be less than or equal to MaxWindows as defined by InitToolsPlus.  If it is not, the Status record is initialized to “false” and 0 values.  MaxWindows defines the maximum number of Tools Plus windows that may be open at any time.
  238.  
  239.   The Status record contains information about the Tools Plus window indicated by the Window value.  The record is defined as such:
  240.  
  241.    struct TPWindowStatus {
  242.      short Kind;             /*Tool Bar, Palette, or Standard kind   */
  243.      Boolean Open;           /*Is the window open?                   */
  244.      Boolean Visible;        /*Is this window visible (not hidden)?  */
  245.      Boolean Active;         /*Is this window active?                */
  246.      Boolean Front;          /*Is this front most Tools Plus window? */
  247.      Boolean Current;        /*Is this the current window?           */
  248.      Boolean WorkWindow;     /*Is this the work window?              */
  249.      Boolean EditFieldWindow;/*Does window have app's active field?  */
  250.      short ActiveField;      /*Window's active field number          */
  251.      Rect StrucRect;         /*Window’s structure rect (global)      */
  252.      Rect ContRect;          /*Window’s content rect (global)        */
  253.      };
  254.    typedef struct TPWindowStatus TPWindowStatus;
  255.  
  256.  
  257.    TPWindowStatus = record    {                                      }
  258.      Kind: integer;           {Tool Bar, Palette, or Standard kind   }
  259.      Open: boolean;           {Is the window open?                   }
  260.      Visible: boolean;        {Is this window visible (not hidden)?  }
  261.      Active: boolean;         {Is this window active?                }
  262.      Front: boolean;          {Is this front most Tools Plus window? }
  263.      Current: boolean;        {Is this the current window?           }
  264.      WorkWindow: boolean;     {Is this the work window?              }
  265.      EditFieldWindow: boolean;{Does window have app's active field?  }
  266.      ActiveField: integer;    {Window's active field number          }
  267.      StrucRect: rect;         {Window’s structure rect (global)      }
  268.      ContRect: rect;          {Window’s content rect (global)        }
  269.    end;
  270.  
  271.  
  272.   Kind indicates the kind of window being referenced.  The various kinds of windows are:
  273.     wNoKind       = 0   Window is not open
  274.     wToolBarKind  = 1   Tool Bar
  275.     wFloatingKind = 2   Floating palette
  276.     wStandardKind = 3   Standard window
  277.  
  278.   Open indicates if the referenced window is open.
  279.  
  280.   Visible indicates if the referenced window is visible or not.  The term “visible” refers to being programatically unhidden.  It does not mean “obscured by other windows or objects.”
  281.  
  282.   Active indicates if the referenced window is active.  A Tools Plus window will not be active under any of the following conditions:
  283.     • the window is not open
  284.     • the referenced window is a standard window, but not the front most
  285.       standard window
  286.     • the active window is a desk accessory (System 5/6’s Finder only)
  287.  
  288.   Front indicates if the referenced window is the front most window in your application.  If your application is not using a tool bar or floating palettes, the front most window is active unless:
  289.     • a desk accessory is active
  290.     • another application or the Finder is active (under MultiFinder or
  291.       System 7)
  292.  
  293.   Current indicates if the referenced window is the current window.  If your application does not use a tool bar or floating palettes, current and active are the same unless you used the CurrentWindow procedure to change the current window number.
  294.  
  295.   WorkWindow indicates if the referenced window is the work window.  This is the same as active if your application does not use a tool bar or floating palettes.
  296.  
  297.   EditFieldWindow indicates if the referenced window contains your application’s active editing field (see the Editing Fields chapter for details).
  298.  
  299.   ActiveField specifies the active editing field number for the referenced window.  For standard windows, this field becomes active when the window is active.  For the tool bar and floating palettes, this field is active while the application is active.
  300.  
  301.   StrucRect is the window’s structure rectangle in global co-ordinates.  This includes the window’s frame, shadow, and title bar.
  302.  
  303.   ContRect is the window’s content rectangle in global co-ordinates.  This is the window’s usable area excluding the window’s frame, shadow, and title bar.
  304.  
  305. CONST                     {Kinds of windows:             }
  306.     wNoKind       = 0;    {Not open                      }
  307.     wToolBarKind  = 1;    {Tool Bar                      }
  308.     wFloatingKind = 2;    {Floating Palette              }
  309.     wStandardKind = 3;    {Standard Window               }
  310.  
  311. ------------------------------------------------------------------------
  312.  
  313. ActiveWindowNumber
  314. ``````````````````
  315. Get the window number of the active window (or work window number if a tool bar and/or floating palettes are used).
  316.  
  317.    pascal short ActiveWindowNumber(void);
  318.  
  319.    function ActiveWindowNumber: INTEGER;
  320.  
  321.   This function returns the window number of the active window.  If your application does not have a tool bar or floating palettes, this is the front most window.  When a tool bar and/or floating palettes are used, ActiveWindowNumber returns the work window number.  A value of zero (0) is returned if any of the following conditions occurs:
  322.     • no windows are open
  323.     • the active window is a desk accessory
  324.     • another application or the Finder is active (under MultiFinder or
  325.       System 7)
  326.  
  327. Also see:  CurrentWindowNumber, FirstWindowNumber, FirstStdWindowNumber, FirstPaletteNumber and WorkWindowNumber.
  328.  
  329. ------------------------------------------------------------------------
  330.  
  331. CurrentWindowNumber
  332. ```````````````````
  333. Get the window number of the current window.
  334.  
  335.    pascal short CurrentWindowNumber(void);
  336.  
  337.    function CurrentWindowNumber: INTEGER;
  338.  
  339.   This function returns the window number of the current window.  If your application does not have a tool bar or floating palettes, this window is the same as the active window unless you used the CurrentWindow procedure to change the current window.  A value of zero (0) is returned if any of the following conditions occurs:
  340.     • no windows are open
  341.     • the current window is a desk accessory
  342.     • another application or the Finder is current (under MultiFinder or
  343.       System 7)
  344.  
  345. Also see: ActiveWindowNumber and FirstWindowNumber.
  346.  
  347. ------------------------------------------------------------------------
  348.  
  349. FirstWindowNumber
  350. `````````````````
  351. Get the window number of your application’s front most window.
  352.  
  353.    pascal short FirstWindowNumber(void);
  354.  
  355.    function FirstWindowNumber: INTEGER;
  356.  
  357.   This function is typically used to determined the front most window in order to close it or apply some equally universal operation to that window.  If your application does not have a tool bar or floating palettes, this is your application’s front most window.  If your application has a tool bar or floating palettes, FirstWindowNumber returns the number of the window that satisfies any of the following conditions (in ascending order of priority):
  358.     • the front most modal window (it is a standard window)
  359.     • the front most floating palette (if one is open and visible)
  360.     • the front most modeless standard window (if one is open and
  361.       visible)
  362. FirstWindowNumber always ignores the tool bar.
  363.  
  364.   A value of zero (0) is returned if no windows are open.  Note that the front most window in your application will not be the active window under any of the following conditions:
  365.     • a desk accessory is active
  366.     • another application or the Finder is active (under MultiFinder or
  367.       System 7)
  368.  
  369. Also see:  CurrentWindowNumber, FirstWindowNumber, FirstStdWindowNumber, FirstPaletteNumber and WorkWindowNumber.
  370.  
  371. ------------------------------------------------------------------------
  372.  
  373. ToolBarNumber
  374. `````````````
  375. Get the window number of your application’s tool bar.
  376.  
  377.    pascal short ToolBarNumber(void);
  378.  
  379.    function ToolBarNumber: INTEGER;
  380.  
  381.   This function returns the window number of your application’s tool bar.  If your application does not have a tool bar, or if the tool bar has been hidden, ToolBarNumber returns a value of zero (0).  You can use this routine in place of a global variable to determine if an event pertains to the tool bar.
  382.  
  383. ------------------------------------------------------------------------
  384.  
  385. FirstPaletteNumber
  386. ``````````````````
  387. Get the window number of your application’s front most floating palette.
  388.  
  389.    pascal short FirstPaletteNumber(void);
  390.  
  391.    function FirstPaletteNumber: INTEGER;
  392.  
  393.   This function returns the window number of your application’s front most visible floating palette.  If your application does not have floating palettes, or if they are all hidden, FirstPaletteNumber returns a value of zero (0).
  394.  
  395. ------------------------------------------------------------------------
  396.  
  397. FirstStdWindowNumber
  398. ````````````````````
  399. Get the window number of your application’s front most standard window.
  400.  
  401.    pascal short FirstStdWindowNumber(void);
  402.  
  403.    function FirstStdWindowNumber: INTEGER;
  404.  
  405.   This function returns the window number of your application’s front most visible standard window.  If your application does not have standard windows, or if they are all hidden, FirstStdWindowNumber returns a value of zero (0).  Note that this window may be modal.
  406.  
  407. ------------------------------------------------------------------------
  408.  
  409. WorkWindowNumber
  410. ````````````````
  411. Get the window number of your application’s work window.
  412.  
  413.    pascal short WorkWindowNumber(void);
  414.  
  415.    function WorkWindowNumber: INTEGER;
  416.  
  417.   This function returns the window number of your application’s work window.  Your application has only one such window which gains its “work window” status under any of the following conditions:
  418.  
  419.    • the user clicks in a window, or any object in a window
  420.  
  421.    • a window is opened as modal (because the next action must take
  422.      place within that window)
  423.  
  424.    • a standard window is opened (and therefore activated), and the
  425.      previous work window was an active standard window
  426.  
  427.    • the work window is closed or hidden, in which case the following
  428.      will become the work window:
  429.         front most standard window (if any are open), or
  430.         front most floating palette (if any are open), or
  431.         the tool bar (if it is open)
  432.  
  433.    • a window is activated
  434.  
  435.   Your application can treat a work window like an active window, in that it is an eligible target for the user’s activity.  If your application does not use a tool bar or floating palettes, the work window is the same as the active window.
  436.  
  437. ------------------------------------------------------------------------
  438.  
  439. EditFldWindowNumber
  440. ```````````````````
  441. Get the window number of the window containing your application’s active editing field.
  442.  
  443.    pascal short EditFldWindowNumber(void);
  444.  
  445.    function EditFldWindowNumber: INTEGER;
  446.  
  447.   This function returns a window pointer to a Tools Plus window regardless if it is open or not.
  448.  
  449.   This function returns the window number of the window containing the active editing field in your application.  If your application does not have a tool bar or floating palettes, this window will either be the active window (front most), or it will be zero (0) when there is no active field.  When a tool bar and/or floating palettes are used, this window can potentially be any of the active windows (tool bar, any floating palette, or the active standard window).  See the Editing Fields chapter for details.
  450.  
  451. ------------------------------------------------------------------------
  452.  
  453. WindowIsOpen
  454. ````````````
  455. Determine if a window is open.
  456.  
  457.    pascal Boolean WindowIsOpen (short Window);
  458.  
  459.    function WindowIsOpen (Window: INTEGER): BOOLEAN;
  460.  
  461.   Window is the window number of a Tools Plus window.  Window must be less than or equal to MaxWindows as defined by InitToolsPlus.
  462.  
  463.   The function’s value returns true if the window is open, and false if the window is not open.  Note that an open window may have been hidden by your application, and therefore not be visible.
  464.  
  465. ------------------------------------------------------------------------
  466.  
  467. WindowIsVisible
  468. ```````````````
  469. Determine if a window is visible (not hidden).
  470.  
  471.    pascal Boolean WindowIsVisible (short Window);
  472.  
  473.    function WindowIsVisible (Window: INTEGER): BOOLEAN;
  474.  
  475.   Window is the window number of a Tools Plus window.  Window must be less than or equal to MaxWindows as defined by InitToolsPlus.
  476.  
  477.   The function’s value returns true if the window is open and visible, and false if the window is not open or not visible.  The term “visible” refers to being programatically unhidden.  It does not mean “obscured by other windows or objects.”
  478.  
  479. ------------------------------------------------------------------------
  480.  
  481. WindowKind
  482. ``````````
  483. Determine a window’s type.
  484.  
  485.    pascal short WindowKind (short Window);
  486.  
  487.    function WindowKind (Window: INTEGER): INTEGER;
  488.  
  489.   Window is the window number of a Tools Plus window.  Window must be less than or equal to MaxWindows as defined by InitToolsPlus.  The window may be hidden.
  490.  
  491.   The function with a value that corresponds to the type of window being referenced.  The four constants that can be used to evaluate a window’s type are wNoKind (window is not open), wToolBarKind, wFloatingKind, and wStandardKind.
  492.  
  493. CONST                     {Kinds of windows:             }
  494.     wNoKind       = 0;    {Not open                      }
  495.     wToolBarKind  = 1;    {Tool Bar                      }
  496.     wFloatingKind = 2;    {Floating Palette              }
  497.     wStandardKind = 3;    {Standard Window               }
  498.  
  499. ------------------------------------------------------------------------
  500.  
  501. WindowPointer
  502. `````````````
  503. Get the pointer to a Tools Plus window.
  504.  
  505.    pascal WindowPtr WindowPointer (short Window);
  506.  
  507.    function WindowPointer(Window: INTEGER): WindowPtr;
  508.  
  509.   This function returns a window pointer to a Tools Plus window regardless if it is open or not.
  510.  
  511.   Window is the window number of a Tools Plus window.  Window must be less than or equal to MaxWindows as defined by InitToolsPlus.  If it is not, nil is returned.
  512.  
  513. ------------------------------------------------------------------------
  514.